/*
Copyright [2023] [fuwen_soft]
*/
package vip.xiaonuo.sys.modular.sysappinfoservice.controller;

import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import vip.xiaonuo.core.pojo.page.PageResult;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import vip.xiaonuo.core.annotion.version.AdminVersionSwagger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import vip.xiaonuo.sys.core.msg.Result;
import vip.xiaonuo.sys.modular.sysappinfoservice.entity.SysAppInfoService;
import vip.xiaonuo.sys.modular.sysappinfoservice.param.SysAppInfoServiceParam;
import vip.xiaonuo.sys.modular.sysappinfoservice.service.SysAppInfoServiceService;

import javax.annotation.Resource;
import java.util.List;

import static vip.xiaonuo.sys.core.msg.ResultUtils.success;

/**
 * APP服务简介控制器
 *
 * @author yanwei
 * @date 2023-03-21 12:07:26
 */
@RestController
@Api(tags = "后台管理 APP服务简介 相关APIS")
@AdminVersionSwagger
public class SysAppInfoServiceController {

    @Resource
    private SysAppInfoServiceService sysAppInfoServiceService;

    /**
     * 查询APP服务简介
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @GetMapping("/sysAppInfoService/page")
    @BusinessLog(title = "APP服务简介_查询", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("APP服务简介_查询")
    public Result<PageResult<SysAppInfoService>> page(SysAppInfoServiceParam sysAppInfoServiceParam) {
        PageResult<SysAppInfoService> page = sysAppInfoServiceService.page(sysAppInfoServiceParam);
        return success(page);
    }

    /**
     * 添加APP服务简介
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @PostMapping("/sysAppInfoService/add")
    @BusinessLog(title = "APP服务简介_增加", opType = LogAnnotionOpTypeEnum.ADD)
    @ApiOperation("APP服务简介_增加")
    public Result add(@RequestBody @Validated(SysAppInfoServiceParam.add.class) SysAppInfoServiceParam sysAppInfoServiceParam) {
            sysAppInfoServiceService.add(sysAppInfoServiceParam);
        return success();
    }

    /**
     * 删除APP服务简介，可批量删除
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @PostMapping("/sysAppInfoService/delete")
    @BusinessLog(title = "APP服务简介_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    @ApiOperation("APP服务简介_删除")
    public Result delete(@RequestBody @Validated(SysAppInfoServiceParam.delete.class) List<SysAppInfoServiceParam> sysAppInfoServiceParamList) {
            sysAppInfoServiceService.delete(sysAppInfoServiceParamList);
        return success();
    }

    /**
     * 编辑APP服务简介
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @PostMapping("/sysAppInfoService/edit")
    @BusinessLog(title = "APP服务简介_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    @ApiOperation("APP服务简介_编辑")
    public Result edit(@RequestBody @Validated(SysAppInfoServiceParam.edit.class) SysAppInfoServiceParam sysAppInfoServiceParam) {
            sysAppInfoServiceService.edit(sysAppInfoServiceParam);
        return success();
    }

    /**
     * 查看APP服务简介
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @GetMapping("/sysAppInfoService/detail")
    @BusinessLog(title = "APP服务简介_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
    @ApiOperation("APP服务简介_查看")
    public Result<SysAppInfoService> detail(@Validated(SysAppInfoServiceParam.detail.class) SysAppInfoServiceParam sysAppInfoServiceParam) {
        SysAppInfoService detail =   sysAppInfoServiceService.detail(sysAppInfoServiceParam);
        return success(detail);
    }

    /**
     * APP服务简介列表
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @GetMapping("/sysAppInfoService/list")
    @BusinessLog(title = "APP服务简介_列表", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("APP服务简介_列表")
    public Result<List<SysAppInfoService>> list(SysAppInfoServiceParam sysAppInfoServiceParam) {
        List<SysAppInfoService> list  =   sysAppInfoServiceService.list(sysAppInfoServiceParam);
        return success(list);
    }

    /**
     * 导出系统用户
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @GetMapping("/sysAppInfoService/export")
    @BusinessLog(title = "APP服务简介_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
    @ApiOperation("APP服务简介_导出")
    public void export(SysAppInfoServiceParam sysAppInfoServiceParam) {
        sysAppInfoServiceService.export(sysAppInfoServiceParam);
    }

}
